    
    // With Oracle having taken over Sun, does that now mean that
    // Oracle owns the JavaScript trademark??
    //
    //
    TestCase
    (
        'ie.ondevice.objectkit.EcmaScriptObjectModelTestCase'

    ,   {
            /* N.B. This test kills JsTestDriver when testing IE over network
             * can only assume that its an issue with IE not being able 
             * to respond to JsTestDriver after encountering an error
             */
            testNativeObjectsAndConstructors: function () 
            {
                var trait= {}
                ,   ecmaScriptNativeObjects= 
                    [
                        'String'
                    ,   'Number'
                    ,   'RegExp'
                    ,   'Boolean'
                    ,   'Object'
                    ,   'Array'
                    ,   'Function'
                    ,   'Error'
                    ]
                    
                    // MSIE does not consider Error subclasses to be native
                    // objects
                ,   ecmaScriptNativeErrors= 
                    [
                        'RangeError'
                    ,   'TypeError'
                    ,   'ReferenceError'
                    ,   'URIError'
                    ,   'EvalError'
                    ,   'SyntaxError'
                    ]  

 
                ,   natives
                ;
                
                if (window.ActiveXObject) 
                {
                    natives= ecmaScriptNativeObjects
                }
                else 
                {
                    natives= ecmaScriptNativeObjects.concat(ecmaScriptNativeErrors);
                }
               
                
                // a little counterintuitive, but true
                assertTrue('Function is an instanceof Function', Function instanceof Function);
                assertTrue('Function is an object', Function instanceof Object);
                assertTrue('new Function instanceof Function', new Function instanceof Function);
                assertTrue('new Function instanceof Object', new Function instanceof Object);
                assertTrue('new function () {} instanceof of Object', new function (){} instanceof Object);
                assertTrue('new new Function instanceof Object', new (new Function) instanceof Object);
                assertFalse('new new Function not a Function instance', new (new Function) instanceof Function);
                
                for (var i= 0, n= natives.length, c, l; i < n; i++) 
                {
                    l= natives[i]
                    c= window[l]
                    assertInstanceOf(l + ' is a native object constructor', Function, c);
                    
                    // all function constructors are Function
                    assertSame(l + ' constructor is Function', Function, c.constructor);
                    assertTrue(l + ' is an instance of Object', c instanceof Object);
                }
                
                // as all native object constructors are instances of Function
                // everything added to Functions prototype is added as a property
                // of every Function, including Function itself. Its this characteristic
                // of JavaScripts object model thats used by ObjectKit to
                // extend it.
                
                for (var i= 0, n= natives.length; i < n; i++) 
                {
                    assertUndefined('There is no temp value added yet', window[natives[i]].value);
                }
                
                var value= {};
                Function.prototype.value= value;
                
                for (var i= 0, n= natives.length; i < n; i++) 
                {
                    assertSame('There is a temp value added', value, window[natives[i]].value);
                }
                
                delete Function.prototype.value;
                
                
            } 
            
        ,   testFunctionExpressionVersusFunctionDeclarations: function () 
            {
                var expression
                ,   reference
                ,   error
                    
                    
                assertUndefined('expressions are not defined until they are encountered', expression);
                assertInstanceOf('declarations are hoisted', Function, declaration);
                try 
                {
                    // the variable namedFunctionDeclaration is not declared in
                    // the above var list, and not as a standalone function
                    // declaration, so a syntax error is thrown
                    assertInstanceOf('this assertion should not exectute', Function, namedFunctionDeclaration);
                }
                catch (thrown) 
                {
                    error= thrown;
                }
                
                // MSIE is broken as usual...
                if (window.ActiveXObject) 
                {
                    assertUndefined('named function expressions are not hoisted', error);
                }
                else 
                {
                    assertInstanceOf('named function expressions are not hoisted', Error, error);
                }
                
                
                // a function expression    
                expression= function () {;};
                
                // a function declaration  
                function declaration () {;};
                
                // a named function expression
                reference= function namedFunctionDeclaration () {;}
            }
        }
    );            
